<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTeacherInfoStatisticsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('teacher_info_statistics', function (Blueprint $table) {
            $table->bigInteger('id', true);
            $table->string('name', 255)->nullable()->index('idx_name')->comment('教师姓名');
            $table->string('title', 255)->nullable()->index('idx_title')->comment('教师职称');
            $table->string('rank', 50)->nullable()->index('idx_rank')->comment('教师岗位等级');
            $table->string('back_bone', 50)->nullable()->index('idx_back_bone')->comment('骨干教师');
            $table->date('work_date')->nullable()->comment('工作时间');
            $table->string('education', 50)->nullable()->comment('教师学历');
            $table->string('subject', 50)->nullable()->index('idx_subject')->comment('教师学科');
            $table->bigInteger('user_id')->index('idx_user_id')->comment('user_id');
            $table->bigInteger('data_version_id')->nullable()->comment('版本id');
            $table->tinyInteger('deleted')->nullable()->default(0);
            $table->dateTime('create_time')->nullable()->useCurrent();
            $table->bigInteger('creator_id')->nullable();
            $table->dateTime('update_time')->nullable()->useCurrent();
            $table->bigInteger('updater_id')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('teacher_info_statistics');
    }
};
